#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1e5 + 5;

int n, w, x, p;
priority_queue<int, vector<int>, greater<int>> mx;
priority_queue<int> mn;

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> w;
  rep(i, 1, n) {
    p = max(1, i * w / 100);
    cin >> x;
    if (mn.size() && x < mn.top())
      mn.push(x);
    else
      mx.push(x);
    while (mx.size() > p) {
      mn.push(mx.top());
      mx.pop();
    }
    while (mx.size() < p) {
      mx.push(mn.top());
      mn.pop();
    }
    cout << mx.top() << ' ';
  }
  return 0;
}